<?php
/*
  Template Name: Culture
 */
?>

<?php
get_header();
?>

        <div class="container clearfix">
        
        	<div class="rightCol">
                
                <div class="sliderkit photoslider-1click">
            <div class="sliderkit-nav">
                <div class="sliderkit-nav-clip">
                    <ul>
                        <?php
                        
						$cultureId = get_cat_ID('news');
						$counter = 1;
						$tempContainer = array();
						$args = array('category__and' => array ($cultureId,$cur_cat_id), 'numberposts' => 8);
						$innerPosts = get_posts($args);
						foreach ($innerPosts as $innerPost) {
						$colorClassName = 'cculture';
						$finalPath = get_the_post_thumbnail($innerPost->ID);
						 $tempContainer[] = array('colorClassName' => $colorClassName, 'imagePath' => $finalPath, 'postTitle' => $innerPost->post_title, 'catName' => 'الثقافة', 'postLink' => get_permalink($innerPost->ID));
						//print_r($tempContainer);
                            ?>
                            <li class="<?php echo $colorClassName ?>">
                                <a href="<?php echo get_permalink($innerPost->ID)?> "><span><?php echo $counter ?></span></a>
                                <div class="sliderkiNavHover">
                                    <div class="sliderInNew">
                                        <?php echo $finalPath; ?>
                                        <h4><?php echo $innerPost->post_title; ?></h4>
                                    </div><!-- sliderInNew -->
                                </div><!-- sliderKitNavHover -->
                            </li>
                            <?php
                            $counter++;
                        }
                        ?>
                    </ul>
                </div><!-- sliderkit-nav-clip -->
            </div><!-- sliderkit-nav -->
            <div class="sliderkit-panels">
                <?php foreach ($tempContainer as $curInfo) { ?>
                    <div class="sliderkit-panel <?php echo $curInfo['colorClassName'] ?>">
                        <a href="#" class="quickRead"> قراءة سريعه </a>
                        <a href="<?php echo $curInfo['postLink'] ?>"><?php echo $curInfo['imagePath'] ?></a>
                        <div class="panelContent">
                            <h3><a href="<?php echo $curInfo['postLink'] ?>"><?php echo $curInfo['postTitle'] ?></a></h3>
                            <div class="panelAbout">
                                <a href="<?php $curInfo['catLink'] ?>" class="panelNewSection"><?php echo $curInfo['catName'] ?></a>
                                <span class="panelNewShares">
                                    <span class="Mybg"></span>
                                    <span>300 </span><a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo urlencode($curInfo['postLink']) ?>" target="_blank">مشاركة</a>
                                </span>
                            </div><!-- panelAbout -->
                        </div><!-- panelContent -->
                    </div><!-- sliderkit-panel -->
                <?php } ?>
            </div><!-- sliderkit-panels -->
        </div><!-- sliderkit -->
            
            	<div class="homeadvsLeaderBoard"><img src="<?php bloginfo('template_url'); ?>/images/leaderBoard.jpg" alt="" /></div>
                
                <div class="sectionsArea">
                	<!--<div class="sectionsAreaTags clearfix">
                    	<h2> مواضيع ساخنه </h2>
                        <ul>
                        	<li class="active">
                            	<a href="#">سياسة</a>
                                <div class="up-triangle"></div>
                            </li>
                            <li>
                            	<a href="#">الأنتخابات</a>
                                <div class="up-triangle"></div>
                            </li>
                            <li>
                            	<a href="#">السيسى</a>
                                <div class="up-triangle"></div>
                            </li>
                            <li>
                            	<a href="#">المحاكمات</a>
                                <div class="up-triangle"></div>
                            </li>
                            <li>
                            	<a href="#">مصر</a>
                                <div class="up-triangle"></div>
                            </li>
                            <li>
                            	<a href="#">مبارك</a>
                                <div class="up-triangle"></div>
                            </li>
                            <li>
                            	<a href="#">التحرير</a>
                                <div class="up-triangle"></div>
                            </li>                                                   
                        </ul>
                    </div>--><!-- sectionsAreaCategories -->
                    
                    
            <div class="sectionNewsArea clearfix" id="section-content">
				<?php 
					echo  loadSection(true , $cur_cat_id);	
				?> 
            </div><!-- sectionNewsArea -->               
                    <a href="#" class="seeMoreFromSection load-chosen" id="load-more" sec="<?php echo $cur_cat_id;?>"> شاهد المزيد </a>
                </div><!-- sectionsArea -->
                
                <div class="newsFromSocial clearfix">
					<?php display_tweets(); ?>
                </div><!-- newsFromSocial -->
                    
                
                
                <div class="sectionsAreaCategories clearfix">
                <h2>البومات الصور</h2>
                <ul>
                    <?php
                    $albumCatId = get_cat_ID('album');
                    $albums = get_posts(array('category__and' => array ( $albumCatId, $cur_cat_id)));
                    $counter = 1;
                    foreach ($albums as $key => $post) {
                        $colorCategory = getColorClassName($post);
                        $colorClass = 'c' . $colorCategory->slug;
                        if ($key === 0) {
//                            $activeClass = ' active';
                            $firstId = "id='first-album'";
                        } else {
//                            $activeClass = '';
                            $firstId = '';
                        }
                        ?>
                        <li class="<?php echo $colorClass; ?> album-act">
                            <a href="#" class="fetch-album" pid="<?php echo $post->ID; ?>" <?php echo $firstId ?>><?php echo $post->post_title; ?></a>
                            <div class="up-triangle"></div>
                        </li>
                        <?php
//                        $counter++;
                    }
                    ?>                                                   
                </ul>
            </div><!-- homePhotoGalleries -->
            <div class="photoAlbums" id="album-container" style="display: none;">

            </div><!-- photoAlbums --> 
            </div><!-- rightCol -->
            
            <div class="sideBar">
            	
                <div class="importantNewsArea">
                    <h2 class="blogersTitle">المدونون</h2>
                    <?php $args = array(
							'blog_id'      => $GLOBALS['blog_id'],
							'role'         => 'author',
					); ?>
                    
                    <div class="blogersPosts">
                    	<div class="scroll-pane">
						<?php 
						$blogusers = get_users($args);
						$counter = 1 ; 
    					foreach ($blogusers as $user) { ?>
                        	<div class="oneBlogPost">
                            	<span class="numberOBP"><?php echo $counter++; ?></span>
                                <?php echo get_avatar( $user->user_email , $size, $default, $user->user_nicename ); ?> 
                                <div class="leftOBP">
	                                <h3><a href="#"><?php echo  $user->user_nicename ?> </a></h3>
                                    <h4><a href="#"><?php  echo count_user_posts( $user->ID ); ?> مقالة </a></h4>
                                </div>
                      
                            </div><!-- oneBlogPost -->
                            <?php }?>  
                        </div><!-- scroll-pane -->
                    </div><!-- blogersPosts -->
                    
                </div><!-- imprtantNewsArea -->
                 <?php get_sidebar(); ?>
    </div><!-- sideBar -->

</div><!-- container -->
<?php get_footer(); ?>
<script type="text/javascript">!function(d, s, id) {
        var js, fjs = d.getElementsByTagName(s)[0];
        if (!d.getElementById(id)) {
            js = d.createElement(s);
            js.id = id;
            js.src = "//platform.twitter.com/widgets.js";
            fjs.parentNode.insertBefore(js, fjs);
        }
    }(document, "script", "twitter-wjs");</script>